





<template>
	<div class="school">
		<h2 >学生名称：{{name}}</h2>
		<h2 class="qwe">学生年龄：{{myage}}</h2>
       <button @click="sendStudentName">传递学习名称App</button>
	</div>
</template>

<script>
export default {
  name: "Student",
  data() {
    return {
      name: "抱抱",
      myage: 19
    };
  },
  methods: {
    sendStudentName() {
      //触发Student组件实例身上的atguigu事件
      this.$emit("setname", this.name, 666, 200, 101);
    }
  }
};
</script>

<style lang="less" scoped>
.school {
  background-color: rgba(232, 147, 160, 0.5);
  margin: 10px 0;
  .qwe {
    font-size: 40px;
  }
}
</style>

